package com.ymttest.database.model.mongo.query;

import java.math.BigDecimal;
import java.util.Date;

import org.springframework.data.mongodb.core.mapping.Field;

import com.ymttest.database.model.annotation.Column;
import com.ymttest.database.model.annotation.Table;

/**
 * 退款信息
 * Created by zhangyifan on 2016/12/8.
 */
public class Refund {

	/**
	 * rfd
	 * 退款单ID
	 */
	@Table("Ymt_RefundBill")
	@Column("RefundBillNo")
	@Field("rfdNo")
	private String refundNo;

	/**
	 * rfd
	 * 申请退款金额
	 */
	@Table("Ymt_RefundBill")
	@Column("RefundAmount")
	@Field("rfdAmt")
	private BigDecimal refundAmount;

	/**
	 * rfd
	 * 退款现金
	 */
	@Table("Ymt_RefundBill")
	@Column("RefundedAmountOfCash")
	@Field("rfdAmtCsh")
	private BigDecimal refundAmountCash;

	/**
	 * rfd
	 * 退款三方折扣
	 */
	@Table("Ymt_RefundBill")
	@Column("RefundedDiscountOfThirdParty")
	@Field("rfd3P")
	private BigDecimal refund3P;

	/**
	 * rfd
	 * 退款时间
	 */
	@Table("Ymt_RefundBill")
	@Column("AddTime")
	@Field("rfdTm")
	private Date refundTime;

	/**
	 * rfd
	 * 退款状态
	 */
	@Table("Ymt_RefundBill")
	@Column("SalesRefundStatus")
	@Field("rfdSt")
	private Integer refundStatus;

	/**
	 * rfd
	 * 退款红包
	 */
	@Table("Ymt_RefundBill")
	@Column("RefundedAmountOfGift")
	@Field("rfdAmtGift")
	private BigDecimal refundAmountGift;

	/**
	 * rfd
	 * 退款优惠券
	 */
	@Table("Ymt_RefundBill")
	@Column("SettlementAmountOfCoupon")
	@Field("rfdAmtCop")
	private BigDecimal refundAmountCop;

	@Table("Ymt_RefundBill")
	@Column("RefundedAmountOfFreight")
	@Field("rfdAmtFreight")
	private BigDecimal refundAmountFreight;

	public String getRefundNo() {
		return refundNo;
	}

	public void setRefundNo(String refundNo) {
		this.refundNo = refundNo;
	}

	public BigDecimal getRefundAmount() {
		return refundAmount;
	}

	public void setRefundAmount(BigDecimal refundAmount) {
		this.refundAmount = refundAmount;
	}

	public BigDecimal getRefundAmountCash() {
		return refundAmountCash;
	}

	public void setRefundAmountCash(BigDecimal refundAmountCash) {
		this.refundAmountCash = refundAmountCash;
	}

	public BigDecimal getRefund3P() {
		return refund3P;
	}

	public void setRefund3P(BigDecimal refund3P) {
		this.refund3P = refund3P;
	}

	public Date getRefundTime() {
		return refundTime;
	}

	public void setRefundTime(Date refundTime) {
		this.refundTime = refundTime;
	}

	public Integer getRefundStatus() {
		return refundStatus;
	}

	public void setRefundStatus(Integer refundStatus) {
		this.refundStatus = refundStatus;
	}

	public BigDecimal getRefundAmountGift() {
		return refundAmountGift;
	}

	public void setRefundAmountGift(BigDecimal refundAmountGift) {
		this.refundAmountGift = refundAmountGift;
	}

	public BigDecimal getRefundAmountCop() {
		return refundAmountCop;
	}

	public void setRefundAmountCop(BigDecimal refundAmountCop) {
		this.refundAmountCop = refundAmountCop;
	}

	public BigDecimal getRefundAmountFreight() {
		return this.refundAmountFreight;
	}

	public void setRefundAmountFreight(BigDecimal refundAmountFreight) {
		this.refundAmountFreight = refundAmountFreight;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof Refund))
			return false;

		Refund refund = (Refund) o;

		if (getRefundNo() != null
				? !getRefundNo().equals(refund.getRefundNo())
				: refund.getRefundNo() != null)
			return false;
		if (getRefundAmount() != null ? !getRefundAmount().equals(
				refund.getRefundAmount()) : refund.getRefundAmount() != null)
			return false;
		if (getRefundAmountCash() != null
				? !getRefundAmountCash().equals(refund.getRefundAmountCash())
				: refund.getRefundAmountCash() != null)
			return false;
		if (getRefund3P() != null
				? !getRefund3P().equals(refund.getRefund3P())
				: refund.getRefund3P() != null)
			return false;
		if (getRefundTime() != null ? !getRefundTime().equals(
				refund.getRefundTime()) : refund.getRefundTime() != null)
			return false;
		if (getRefundStatus() != null ? !getRefundStatus().equals(
				refund.getRefundStatus()) : refund.getRefundStatus() != null)
			return false;
		if (getRefundAmountGift() != null
				? !getRefundAmountGift().equals(refund.getRefundAmountGift())
				: refund.getRefundAmountGift() != null)
			return false;
		return getRefundAmountCop() != null
				? getRefundAmountCop().equals(refund.getRefundAmountCop())
				: refund.getRefundAmountCop() == null;

	}

	@Override
	public int hashCode() {
		int result = getRefundNo() != null ? getRefundNo().hashCode() : 0;
		result = 31
				* result
				+ (getRefundAmount() != null ? getRefundAmount().hashCode() : 0);
		result = 31
				* result
				+ (getRefundAmountCash() != null ? getRefundAmountCash()
						.hashCode() : 0);
		result = 31 * result
				+ (getRefund3P() != null ? getRefund3P().hashCode() : 0);
		result = 31 * result
				+ (getRefundTime() != null ? getRefundTime().hashCode() : 0);
		result = 31
				* result
				+ (getRefundStatus() != null ? getRefundStatus().hashCode() : 0);
		result = 31
				* result
				+ (getRefundAmountGift() != null ? getRefundAmountGift()
						.hashCode() : 0);
		result = 31
				* result
				+ (getRefundAmountCop() != null ? getRefundAmountCop()
						.hashCode() : 0);
		return result;
	}
}
